/**
 * 系统用户修改js
 */
var comValidform=null;
var returnStatus=false;

var orderUpdate={
	dataCache:null,
	duties:null,
	
	bindChangeDept:function(val){
	},
	
	startEvent:function(){
		
		 
		
		//更改职务提交
		comValidform=$(".com-addForm").Validform({
			datatype : {
				"bb0-11" : /^(\d{11})$/
			},
			tiptype:2,
			tipSweep:true,
			beforeSubmit:function(curform){
				
				var url = 'mgr/order/updateCode';
				var params = jsUtils.serializeJson($('.com-addForm'));
				params.actUserId = userId;
				var cb = function(data){
					alert(data.msg);
					//成功返回
					if(data.resultCode==200){
						//关闭窗口并刷新数据
						art.dialog.close();
						returnStatus=true;
					}
				};
				sendApiNoLoadSync(url, params, cb, 'POST');
				return false;
			}
		});
	},
	showInfoById:function(){
		var orderId=art.dialog.data('updId');   
		var recommendCode=art.dialog.data('recommendCode');  //修改id
		var channel=art.dialog.data('channel');
		 
		$('.com-addForm input[name="recommendCode"]').val(recommendCode);
		$('.com-addForm input[name="id"]').val(orderId);
		$('.com-addForm select[name="channel"]').val(channel);
	},
	
	init:function(){
		orderUpdate.showInfoById();
		orderUpdate.startEvent();
	}
}
$(document).ready(function() {
	orderUpdate.init();
});

function submitForm(){
	comValidform.submitForm();
	return returnStatus;
}